function clearImports() {
	if [ -d $1 ]; then
		find $1 -type f | xargs sed -i 's///g'
		echo "find and replace done";
	else
		echo "Invalid directory"
	fi;
}

function fixImports() {
    find $1 -type f -name *java | xargs sed -i '3iimport pl.wcislo.sbql4j.db4o.Db4oSBQLQuery;'
    find $1 -type f -name *java | xargs sed -i 's/import pl.wcislo.sbql4j.lang.db4o.*//g'
    echo "Import fixxing done!"
}

function sbql4jFull() {
    sbql4j $1 && \
    fixImports $1 && \
    installProject $1
}

function installProject() {
	if [ -d $1 ]; then
		cd $1
		mvn clean install
		cd -
	else
		echo "Invalid directory"
	fi
}

function sbql4j() {
	ant -Dproject=$1
}

function killjetty() {
	kill -9 `jps -lv | grep org.codehaus.classworlds.Launcher | cut -d' ' -f1`
}
